Zum Hauptinhalt springen
Version: 5.1

TimePunch Async Sync Service

Dieser Service stellt Methoden zum asynchronen Importieren von Daten bereit. Das asynchrone Importieren hat den Vorteil, dass über einen Callback Service die prozentuale Fertigstellung zurückgemeldet wird. Dies kann bei einem langlaufenden Import ein Vorteil sein.

ApplyStaticData

Diese Methode importiert die übergebenen Projekte und Kunden und fügt diese mit den bereits Vorhandenen zusammen.

void ApplyStaticData(  
TpAuthentication authentication,
IEnumerable<ProjectDto> projects,
IEnumerable<TaskDto> commonTasks,
IEnumerable<CustomerDto> customers);
Needed Permissionprojects@download
NameModifierDescription
authenticationUser authentication
projectsCollection of projects that shall be imported.
commonTasksCollection of common tasks that shall be imported.
customersCollection of customers that shall be imported.

ApplyTimeEntries

Diese Methode importiert die übergebenen Zeiteinträge und fügt diese mit den bereits vorhandenen zusammen.

void ApplyTimeEntries(  
TpAuthentication authentication,
IEnumerable<TimeEntrySaveDto> timeEntries,
IEnumerable<ProjectDto> projects,
IEnumerable<TaskDto> commonTasks,
IEnumerable<CustomerDto> customers);
Needed Permissionprojects@download
NameModifierDescription
authenticationUser authentication
timeEntriesCollection of time entries to impoert
projectsCollection of projects that are referenced by the time entries.
commonTasksCollection of common tasks that are referenced by the time entries.
customersCollection of customers that that are referenced by the time entries.

ITpSyncCallbackService

Um den Callback Service zu nutzen, muss das ITpSyncCallbackService Interface vom Client implementiert werden.

Code Snippet

[ServiceContract]  
public interface ITpSyncCallbackService
{
/// <summary>
/// Informs the Client that the current sync failed with an exception
/// </summary>
/// <param name="fault">The fault.</param>
[OperationContract (IsOneWay=true)]
void SyncFailed(TpFault fault);

/// <summary>
/// Informs the Client that the current sync succeeded properly
/// </summary>
[OperationContract(IsOneWay = true)]
void SyncSucceeded();

/// <summary>
/// Informs the Client about the progress of the sync process
/// </summary>
[OperationContract(IsOneWay = true)]
void SyncProgress(int percent);
}